<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace='ManagementList' xmlns='http://ibatis.apache.org/mapping' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <alias>
    <typeAlias alias='ManagementList' assembly='Janus.Mes.POCO.dll' type='Janus.Mes.POCO.ManagementList' />
  </alias>
  <resultMaps>
    <resultMap id='ManagementListResult' class='ManagementList'>
	<result property='Id' column='Id' /> 
	<result property='Category' column='Category' /> 
	<result property='Code' column='Code' /> 
	<result property='Name' column='Name' /> 
	<result property='IsEnable' column='IsEnable' /> 
	<result property='Brand' column='Brand' /> 
	<result property='Model' column='Model' /> 
	<result property='SystemName' column='SystemName' /> 
	<result property='IPAddress' column='IPAddress' /> 
	<result property='cType' column='cType' /> 
	<result property='IO' column='IO' /> 
	<result property='Port' column='Port' /> 
	<result property='Remark' column='Remark' /> 
	<result property='Creator' column='Creator' /> 
	<result property='CreateDate' column='CreateDate' /> 
	<result property='Updater' column='Updater' /> 
	<result property='UpdateDate' column='UpdateDate' /> 
	<result property='IsDelete' column='IsDelete' /> 
	<result property='CreatorCode' column='CreatorCode' /> 
	<result property='UpdaterCode' column='UpdaterCode' /> 
	<result property='OperDept' column='OperDept' /> 
	<result property='Timestamp' column='Timestamp' /> 
		</resultMap>
  </resultMaps>  
  <statements>
  <sql id="UpdaterConditions">  
  <dynamic prepend="SET">
          	<isPropertyAvailable prepend="" property="Name">
        <isNotEmpty prepend="," property="Name">
		          [Name]=#Name#
		          </isNotEmpty>
      </isPropertyAvailable>	
	      	<isPropertyAvailable prepend="" property="Brand">
        <isNotEmpty prepend="," property="Brand">
		          [Brand]=#Brand#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Model">
        <isNotEmpty prepend="," property="Model">
		          [Model]=#Model#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="SystemName">
        <isNotEmpty prepend="," property="SystemName">
		          [SystemName]=#SystemName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IPAddress">
        <isNotEmpty prepend="," property="IPAddress">
		          [IPAddress]=#IPAddress#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="cType">
        <isNotEmpty prepend="," property="cType">
		          [cType]=#cType#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IO">
        <isNotEmpty prepend="" property="IO">
				  <isNotEqual prepend="," property="IO" compareValue="0">
		          [IO]=#IO#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Port">
        <isNotEmpty prepend="," property="Port">
		          [Port]=#Port#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">
		          [Remark]=#Remark#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="," property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="," property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="," property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	 </dynamic>
    </sql>
	<sql id="WhereConditions">
	 <dynamic prepend="WHERE">
	 	 <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="AND" property="Id">
		          [Id]=#Id#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Category">
        <isNotEmpty prepend="AND" property="Category">
		          [Category]=#Category#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Code">
        <isNotEmpty prepend="AND" property="Code">
		          [Code]=#Code#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Name">
        <isNotEmpty prepend="AND" property="Name">
		          [Name]=#Name#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IsEnable">
        <isNotEmpty prepend="AND" property="IsEnable">
		          [IsEnable]=#IsEnable#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Brand">
        <isNotEmpty prepend="AND" property="Brand">
		          [Brand]=#Brand#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Model">
        <isNotEmpty prepend="AND" property="Model">
		          [Model]=#Model#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="SystemName">
        <isNotEmpty prepend="AND" property="SystemName">
		          [SystemName]=#SystemName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IPAddress">
        <isNotEmpty prepend="AND" property="IPAddress">
		          [IPAddress]=#IPAddress#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="cType">
        <isNotEmpty prepend="AND" property="cType">
		          [cType]=#cType#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IO">
        <isNotEmpty prepend="" property="IO">
				  <isNotEqual prepend="AND" property="IO" compareValue="0">
		          [IO]=#IO#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Port">
        <isNotEmpty prepend="AND" property="Port">
		          [Port]=#Port#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="AND" property="Remark">
		          [Remark]=#Remark#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="AND" property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="AND" property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="AND" property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="AND" property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="AND" property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="AND" property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="AND" property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="AND" property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="" property="Timestamp">
				  <isNotEqual prepend="AND" property="Timestamp" compareValue="1900-01-01">
		          [Timestamp]=#Timestamp#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic> 
    </sql>
	<sql id="InsertPublic">
      INSERT INTO ManagementList(
	     <dynamic prepend=" ">
       	   <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">
          [Id]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Category">
        <isNotEmpty prepend="," property="Category">
          [Category]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Code">
        <isNotEmpty prepend="," property="Code">
          [Code]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Name">
        <isNotEmpty prepend="," property="Name">
          [Name]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IsEnable">
        <isNotEmpty prepend="," property="IsEnable">
          [IsEnable]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Brand">
        <isNotEmpty prepend="," property="Brand">
          [Brand]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Model">
        <isNotEmpty prepend="," property="Model">
          [Model]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="SystemName">
        <isNotEmpty prepend="," property="SystemName">
          [SystemName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IPAddress">
        <isNotEmpty prepend="," property="IPAddress">
          [IPAddress]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="cType">
        <isNotEmpty prepend="," property="cType">
          [cType]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IO">
        <isNotEmpty prepend="," property="IO">
          [IO]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Port">
        <isNotEmpty prepend="," property="Port">
          [Port]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">
          [Remark]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
          [Creator]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">
          [CreateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
          [Updater]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">
          [UpdateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">
          [IsDelete]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
          [CreatorCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
          [UpdaterCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
          [OperDept]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">
          [Timestamp]
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
      VALUES
      (
	   <dynamic prepend=" ">
      	<isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">		
         #Id#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Category">
        <isNotEmpty prepend="," property="Category">		
         #Category#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Code">
        <isNotEmpty prepend="," property="Code">		
         #Code#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Name">
        <isNotEmpty prepend="," property="Name">		
         #Name#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IsEnable">
        <isNotEmpty prepend="," property="IsEnable">		
         #IsEnable#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Brand">
        <isNotEmpty prepend="," property="Brand">		
         #Brand#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Model">
        <isNotEmpty prepend="," property="Model">		
         #Model#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="SystemName">
        <isNotEmpty prepend="," property="SystemName">		
         #SystemName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IPAddress">
        <isNotEmpty prepend="," property="IPAddress">		
         #IPAddress#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="cType">
        <isNotEmpty prepend="," property="cType">		
         #cType#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IO">
        <isNotEmpty prepend="," property="IO">		
         #IO#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Port">
        <isNotEmpty prepend="," property="Port">		
         #Port#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">		
         #Remark#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">		
         #Creator#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">		
         #CreateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">		
         #Updater#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">		
         #UpdateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">		
         #IsDelete#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">		
         #CreatorCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">		
         #UpdaterCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">		
         #OperDept#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">		
         #Timestamp#		
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
    </sql>
	<!-- Insert statement:新增Mapper-->
    <insert id='Insert' parameterClass='ManagementList'>
      <include refid="InsertPublic"/>
    </insert>
    <!--Update statement:修改Mapper-->
    <update id='Update' parameterClass='ManagementList'>
      UPDATE [ManagementList] 
      <include refid="UpdaterConditions"/>
      WHERE 1=1
	  	  AND Category=#Category#
	  	  AND Code=#Code#
	  	  AND IsEnable=#IsEnable#
	      </update>
    <update id='UpdateSetion' parameterClass='hashtable'>
      UPDATE [ManagementList] 
      <include refid="UpdaterConditions"/>
      WHERE $conditions$
    </update>
	<update id='Save' parameterClass='ManagementList'>
      IF NOT EXISTS(SELECT 1 FROM [ManagementList] WHERE 1=1  AND [Category]=#Category#  AND [Code]=#Code#  AND [IsEnable]=#IsEnable# )
      BEGIN
      <include refid="InsertPublic"/>
      END
      ELSE
      BEGIN
      UPDATE ManagementList 
      <include refid="UpdaterConditions"/>
      WHERE  1=1
	  	  AND [Category]=#Category#
	  	  AND [Code]=#Code#
	  	  AND [IsEnable]=#IsEnable#
	        END
    </update>
	<delete id='Delete' parameterClass='hashtable'>
      DELETE FROM [ManagementList] WHERE	  
        <![CDATA[  
	 [Category]=#pk0#  AND [Code]=#pk1#  AND [IsEnable]=#pk2# 
        ]]>
    </delete>
    <delete id='DeleteWhere' parameterClass='string'>
      DELETE FROM [ManagementList] WHERE $value$
    </delete>

    <!-- select by key statement:-->
    <select id='FindOne' parameterClass='hashtable' resultClass='ManagementList'>
      SELECT * FROM ManagementList WHERE      
        <![CDATA[
		[Category]=#pk0#  AND [Code]=#pk1#  AND [IsEnable]=#pk2# 
        ]]>
    </select>
    <select id='FindAllCondition' parameterClass='string' resultClass='ManagementList'>
      SELECT * FROM [ManagementList] WHERE $value$
    </select>
    <select id='FindScalar' parameterClass='hashtable' resultClass='ManagementList'>
      SELECT * FROM [ManagementList] WHERE $conditions$
    </select>
    
    <select id='FindAllCount' parameterClass='string' resultClass='int'>
      SELECT COUNT(1) FROM [ManagementList] WHERE $value$
    </select>
    <select id='FindByPage' parameterClass='string' resultClass='ManagementList'>
      SELECT * FROM [ManagementList] WHERE $value$
    </select>
  </statements>
</sqlMap>
